#include<stdio.h>
void main()
{
	int a,b,c;
	int d;
    
	for(d=100;d<=999;d++)
	{
		a=d/100;
		b=d/10%10;
		c=d%10;

		if(d == a*a*a + b*b*b+ c*c*c)
			printf("%d ",d);
	}
	printf("\n");
}